package com.deng.spring.myapp;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.function.Predicate;

/**
 * @author 邓力宾
 * @date 2020/7/1 15:09
 * @desc 自定义 ImportSelector
 */
public class OrderSelector implements ImportSelector {
	@Override
	public String[] selectImports(AnnotationMetadata importingClassMetadata) {
		System.out.println("OrderSelector selector");
		return new String[]{"com.deng.spring.myapp.OrderConfig"}; // 返回一个配置类
		//return new String[0];
	}

	@Override
	public Predicate<String> getExclusionFilter() {
		return null;
	}
}
